/*
 * Copyright (c) 2010-2011 GOV.
 * [Id:PopupBean.java  11-9-9 PM2:16 poplar.mumu ]
 */
package org.mumu.pawn.beans.common;

import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import java.io.Serializable;

/**
 * 弹出页面控制标题以及URL.
 * <br/>
 *
 * @author poplar.mumu
 * @version 1.0 11-9-9 PM2:16
 * @since JDK 1.5
 */
@Named("popup")
@ConversationScoped
public class PopupBean implements Serializable {

    private static final long serialVersionUID = 1807461716895807871L;

    /**
     * 标题
     */
    private String title = "提示信息";
    /**
     * 内容URL,引入xhtml的地址,非http地址
     */
    private String contentUrl = "/WEB-INF/common/blank.xhtml";

    /**
     * 需要刷新的组件
     */
    private String reRender = "yamPopupTitle,yamPopupContent";

    /**
     * 获取标题
     *
     * @return 标题
     */
    public String getTitle() {
        return title;
    }


    /**
     * 内容地址
     *
     * @return 内容地址
     */
    public String getContentUrl() {
        System.out.println(contentUrl);
        return contentUrl;
    }

    public String getReRender() {
        return reRender;
    }

    /**
     * 模式对话窗口控制
     *
     * @param panelName 模式对话窗口标题
     * @param panelUrl  模式对话窗口内部页面uRL
     */
    public void toModal(String panelName, String panelUrl) {
        this.title = panelName;
        this.contentUrl = panelUrl;
    }

    /**
     * 设置弹出窗标题.
     * @param title 标记
     */
    public void toTitle(String title){
        this.title = title;
    }
  

}
